package com.team.lostProperty.service.impl;

import com.team.lostProperty.mapper.UserDao;
import com.team.lostProperty.entity.User;
import com.team.lostProperty.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * @author duzq
 * @date 2020/07/22 14:38
 **/
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public int getAllCount() {
        return userDao.getAllCount();
    }

    @Override
    public List<User> getUser(int page, int limit) {
        int start = (page - 1) * limit;
        return userDao.getUser(start, limit);
    }

    @Override
    public int deleteUser(int id) {
        return userDao.deleteUser(id);
    }

    @Override
    public List<User> selectUser(User user) {
        return userDao.selectUser(user);
    }

    @Override
    public int updateUser(User user) {
        return userDao.updateUser(user);
    }

    @Override
    public int addUser(User user) { return userDao.addUser(user); }

    @Override
    public List<User> login(User user) {
        return userDao.login(user);
    }

    @Override
    public User getUserByName(String userName) {
        return userDao.getUserByName(userName);
    }

}
